package com.xingcheng.discord.midjourney;

import net.dv8tion.jda.api.utils.data.DataArray;
import net.dv8tion.jda.api.utils.data.DataObject;

/**
 * @author xingchen
 * @version 1.0.0
 * @title EventHandle
 * @description
 * @create 2023/12/31 16:08
 **/
public interface EventHandle {

    public void  handle(MessageType messageType, DataObject data);



    default boolean hasImage(DataObject data) {
        DataArray attachments = data.optArray("attachments").orElse(DataArray.empty());
        return !attachments.isEmpty();
    }
}
